<?php 
header("content-type:text/html;charset=utf-8");
$name=isset($_POST['name'])?$_POST['name']:"";
$pwd=isset($_POST['pwd'])?$_POST['pwd']:'';
$rname=isset($_POST['rname'])?$_POST['rname']:'';
$gz=isset($_POST['gz'])?$_POST['gz']:'';
$dsn="mysql:host=127.0.0.1;dbname=zice;charset=utf8";
$db=new PDO($dsn,'root','root');
$sql="insert into yuan(name,pwd,rname,gz) value('$name','$pwd','$rname','$gz')";
$res=$db->exec($sql);
if($res){
	echo "<script>alert('添加成功');location.href='show.php';</script>";
}else{
	echo "<script>alert('添加失败');</script>";
}







 ?>